﻿using LDM.Framework.Application;
using Microsoft.AspNetCore.Builder;

namespace LDM.Framework;

public static class SwaggerBuilderApplicationBuilderExtensions
{
    public static IApplicationBuilder UseSwaggerDoc(this IApplicationBuilder app)
    {
        if (App.AppSettings.EnableSwagger)
        {
            app.UseSwagger();
            app.UseSwaggerUI(options => SwaggerManager.ConfigureUseSwaggerUI(options));
        }
        return app;
    }
}
